#include <bits/stdc++.h>
using namespace std;
const int maxt = 200+10;
const int maxn = 50+5;
const int INF = 1<<30;

#define submit
#ifdef submit
#define endl "\n"
#endif

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    int N;
    int cas = 0;
    while(cin >> N && N){
        int t[maxn];
        int toLeft[maxn], toRight[maxn];
        bool has_train[maxt][maxn][2]; // time, station.  0:1->n, 1:1<-n
        memset(has_train, false, sizeof(has_train));
        int T; cin >> T;
        toRight[1] = 0;
        for (int i = 1; i <= N-1; ++i) {
            cin >> t[i];
            toRight[i+1] = toRight[i] + t[i];
        }
        toLeft[N] = 0;
        for (int i = N-1; i >=1 ; --i) {
            toLeft[i] = toLeft[i+1]+t[i];
        }
        int M1, M2;
        cin >> M1;
        for (int i = 1; i <= M1; ++i) {
            int start; cin >> start;
            for (int stop = 1; stop <= N; ++stop) {
                int time = start + toRight[stop];
                if(time <=T) has_train[time][stop][0] = true;
                else break;
            }
        }
        cin >> M2;
        for (int i = 1; i <= M2; ++i) {
            int start; cin >> start;
            for (int stop = N; stop >=1; --stop) {
                int time = start + toLeft[stop];
                if(time <=T) has_train[time][stop][1] = true;
                else break;
            }
        }

        int dp[maxt][maxn];
        for (int i = 1; i <=N-1 ; ++i) {
            dp[T][i] = INF;
        }
        dp[T][N] = 0;
        for (int i = T-1; i >= 0 ; --i) {
            for (int j = 1; j <=N; ++j) {
                dp[i][j] = dp[i+1][j] + 1;
                if(j < N && has_train[i][j][0] && i+t[j]<=T)    //right
                    dp[i][j] = min(dp[i][j], dp[i+t[j]][j+1]);
                if(j > 1 && has_train[i][j][1] && i+t[j-1]<=T)  //left
                    dp[i][j] = min(dp[i][j], dp[i+t[j-1]][j-1]);
            }
        }
        cout << "Case Number " << ++cas << ": ";
        if(dp[0][1]<INF) cout << dp[0][1] << endl;
        else cout << "impossible" << endl;
    }
    return 0;
}